import router from "./index"
import store from "../store/index"

router.beforeEach((to, from, next) => {
  if (to.matched.some((ele) => ele.meta.isLoagin)) {
    let token = store.state.loginModule.userinfo.token
    if (token) {
      next()
    } else {
      next("./login")
    }
  } else {
    next()
  }
})
